package com.lwl.blue.commont.enums;

/**
 * @author: 蓝文良
 * @Date: 2022 04:2022/4/24
 */
public enum SourceTypeEnum {
    ITEM("产品", "item","T"),
    SUPPLIER("工厂", "supplier","GC"),
    QUOTATION_DETAIL("报价资料明细", "quotationDetail","Q"),
    CONTRACT_DETAIL("客人订单明细", "contractDetail","C"),
    SUPPLIER_CONTRACT_DETAIL("工厂订单明细", "supplierContractDetail","S"),
    QUOTATION_TEMPLATE("报价单模板", "quotationTemplate","S"),
    SAMPLE_DETAIL("样品单资料明细", "sampleDetail","SS");


    private final String name;
    private final String value;
    private final String weight;


    SourceTypeEnum(String name, String value,String weight) {
        this.name = name;
        this.value = value;
        this.weight=weight;
    }

    public String getValue() {
        return this.value;
    }

    public String getName() {
        return this.name;
    }

    public static String getName(String value) {
        for (SourceTypeEnum sourceTypeEnum : SourceTypeEnum.values()) {
            if (sourceTypeEnum.getValue().equals(value)) {
                return sourceTypeEnum.getName();
            }
        }
        return null;
    }
    public static String getWeight(String value) {
        for (SourceTypeEnum sourceTypeEnum : SourceTypeEnum.values()) {
            if (sourceTypeEnum.getValue().equals(value)) {
                return sourceTypeEnum.getName();
            }
        }
        return null;
    }

}
